# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 10:16
# @Author  : 刘张宇
# @Email   : 2285524065@qq.com
# @File    : .py
# @Software: PyCharm

from appium.webdriver.common.mobileby import MobileBy as By
from pages.base_page import BasePage

class KitchenTools(BasePage):
    kitchen_tools_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/dt_kitchen_ware"]')#点击厨房工具定位器
    add_kitchen_tools_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/rv_brand"]/android.widget.FrameLayout[1]')#添加厨房工具定位器
    edit_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/navigation_item_right_view_layout"]')#清理的编辑
    title_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/name"]')

    def menu_kitchen_tools(self):
        self.find_element(self.kitchen_tools_locator).click()#点击厨房工具

    def menu_add_kitchen_tools(self):
        self.find_element(self.add_kitchen_tools_locator).click()#点击添加厨具

    def menu_edit(self):
        self.find_element(self.edit_locator).click()#点击（清理）的编辑

    def menu_delete_kitchen_tools(self):
        self.find_element(self.add_kitchen_tools_locator).click()#点击（清理）取消

    def task_first(self):
        current_task = self.find_element(self.title_locator).text()
        return current_task


